// src/types/index.ts
export interface User {
    id: number;
    email: string;
    username: string;
    avatarUrl?: string;
    createdAt: string;
    emailVerified: boolean;
}

export interface Subscription {
    plan: 'FREE' | 'BASIC' | 'PREMIUM';
    expiryTime?: string;
    autoRenew: boolean;
    features: string[];
}

// 基础数据类型定义
export interface ChatMessage {
    id: string;
    role: 'user' | 'assistant' | 'system';
    content: string;
    timestamp?: string | Date;
    conversationId?: string;
    tokensUsed?: number;
}

export interface Translation {
    id?: string;
    sourceText: string;
    translatedText: string;
    sourceLang: string;
    targetLang: string;
    createdAt?: string | Date;
    detectedLanguage?: string;
    confidence?: number;
}

export interface VoiceRecord {
    id?: string;
    text: string;
    audioUrl?: string;
    duration: number;
    confidence: number;
    language?: string;
    createdAt?: string | Date;
}

// 后端响应类型定义
export interface BackendChatHistoryResponse {
    messages: Array<{
        id: string;
        conversationId: string;
        userMessage: string;
        aiReply: string;
        createdAt: string;
        tokensUsed: number;
    }>;
    total: number;
    hasMore: boolean;
}

